<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">


    <ui:composition template="../../master.xhtml">
        <ui:define name="menu">
            <ui:include src="../menu.xhtml" /> 
        </ui:define>

        <ui:define name="TituloModulo">

            Gestão de Utilizadores
        </ui:define>

        <ui:define name="TituloConteudoPrincipal">
            Visualizar Permissão
        </ui:define>


        <ui:define name="ConteudoPrincipal">

            <p:messages globalOnly="true"/>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputText value="#{bundle.ViewPermissaoUsuarioLabel_caminho}"/>
                    <h:outputText value="#{permissaoUsuarioController.selected.caminho}" title="#{bundle.ViewPermissaoUsuarioTitle_caminho}"/>
                    <h:outputText value="#{bundle.ViewPermissaoUsuarioLabel_accao}"/>
                    <h:outputText value="#{permissaoUsuarioController.selected.accao}" title="#{bundle.ViewPermissaoUsuarioTitle_accao}"/>
                </h:panelGrid>


                <p:orderList value="#{permissaoUsuarioController.selected.tipoUsuarioCollection}" rendered="#{permissaoUsuarioController.selected.tipoUsuarioCollection.size()!=0}"
                             var="tipo" controlsLocation="none"  
                             itemLabel="#{tipo.designacao}" itemValue="#{tipo}"/>
                <h:outputText value="Sem Pemissões associadas" rendered="#{permissaoUsuarioController.selected.tipoUsuarioCollection.size()==0}"/>


                <p:commandButton ajax="false" action="#{permissaoUsuarioController.destroyAndView}" value="#{bundle01.eliminar}"/>

                <p:commandButton ajax="false" action="Edit" value="#{bundle01.editar}"/>

            </h:form>
        </ui:define>
    </ui:composition>

</html>
